FROM php:7.2.34-fpm-alpine
RUN apk add $PHPIZE_DEPS nginx supervisor tzdata libzip-dev\
    && pecl install redis \
    && pecl install mongodb \
    && pecl install zip \
    && docker-php-ext-enable redis mongodb zip \
    && mkdir /data \
    && mkdir /run/nginx \
    && mkdir /etc/supervisor.d \
    && mkdir /var/log/supervisor \
    && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone \
    && curl -sS https://getcomposer.org/installer | php \
    && mv composer.phar /usr/local/bin/composer \
    && composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ \
    && apk del $PHPIZE_DEPS
    
    
COPY ./nginx/conf.d /etc/nginx/conf.d
COPY ./supervisor /etc/supervisor.d
COPY ./crontabs/www-data /etc/crontabs/www-data
COPY ./php/conf.d/date.ini /usr/local/etc/php/conf.d/date.ini
COPY ./start.sh /

#COPY ./data /data

WORKDIR /data

EXPOSE 80

ENTRYPOINT ["sh", "/start.sh"]